home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11546 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.sources.wanted,comp.lang.c,comp.unix.programmer
  4. Subject: Re: Seek unix2dos.c OR help with tr
  5. Date: 22 Mar 96 18:46:50 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.827520410@rscernix>
  8. References: <danpop.826917054@rscernix> <4is3c3$jmp@ns.broadvision.com>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4is3c3$jmp@ns.broadvision.com> patrick@broadvision.com (Patrick Horgan) writes:
  13.  
  14. >In article <danpop.826917054@rscernix>, danpop@mail.cern.ch (Dan Pop) writes:
  15.  
  16. >>As for Kazimir's example, a "better" definition would be:
  17. >>
  18. >>#define CTRL(C) ((C) - 'A' + 1)
  19. >
  20. >If I went down this path I'd choose ((C) - '@' )...somehow the + 1 seems as if it
  21. >will lead to further silly misunderstandings by junior programmers...
  22.  
  23. And your approach will confuse anybody who doesn't know the ASCII table
  24. by heart :-)  In this context, '@' _is_ a magical constant.
  25.  
  26. Dan
  27. --
  28. Dan Pop
  29. CERN, CN Division
  30. Email: danpop@mail.cern.ch 
  31. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  32.